package com.token.sysflow.core;
import com.token.sql.IntegrateSql;
import com.token.sysflow.hander.Notify;
import com.token.sysflow.impl.AbstractFlowHandlerImpl;
import com.token.sysflow.impl.CCFlowImpl;
import java.util.Arrays;
import java.util.List;

/**
 * 抄送
 * @author chenjianxiong 2020/4/13
 */
public class CCFlow extends AbstractFlowCore{
    public CCFlow(IntegrateSql f, String keyUnid) throws Exception{
        super(f,keyUnid);
    }


    @Override
    public void execute(AbstractFlowHandlerImpl flowHandler) throws Exception{
        CCFlowImpl  ccFlow = (CCFlowImpl) flowHandler;

        //检查流程状态，结束和终止不允许操作
        checkFlowStatus();

        List<String> list = Arrays.asList(ccFlow.getSelectApprover());

        //处理知会
        Notify notify = new Notify(this.getISql());
        notify.setSubject("流程抄送:【"+ approveProcess.getFlowNo() +"】");
        notify.setMessage(flowHandler.getOpinions());
        notify.setActionUserId(flowHandler.getActionUser());
        notify.setSendUsers(list);
        notify.setStep(approveProcess.getStep());
        notify.insertSystemNotify();
        notify.close();

    }
}
